var setCommonpx = function () {
  var obj = {}
  for (var i = 0; i <= 500; i++) {
    obj[i] = i + 'px'
  }
  return obj
}

var setCommonWeight = function () {
  var obj = {}
  for (var i = 100; i <= 900; i += 100) {
    obj[i] = i
  }
  return obj
}
tailwind.config = {
  theme: {
    // 各个分辨率设置
    screens: {
      xl: { max: '1600px' },
      m1400: { max: '1400px' },
      lg: { max: '1280px' },
      md: { max: '1024px' },
      sm: { max: '768px' },
      xs: { max: '640px' },
    },
    // 各个样式属性的设置
    extend: {
      colors: {},
      fontSize: setCommonpx(),
      spacing: setCommonpx(),
      borderRadius: setCommonpx(),
      fontWeight: setCommonWeight(),
      lineHeight: setCommonpx(),
      zIndex: {},
      width: setCommonpx(),
    },
  },
}

$(function () {
  // 展开收缩逻辑开始
  if ($('.common-dolsca').siblings('.common-lourew').length > 0) {
    $('.common-dolsca')
      .eq(0)
      .toggleClass('on')
      .siblings()
      .stop(false, true)
      .slideToggle()
      .parent()
      .siblings()
      .children('.common-dolsca')
      .removeClass('on')
      .siblings()
      .stop(false, true)
      .slideUp()
  }
  $('.common-dolsca').click(function () {
    if ($(this).siblings('.common-lourew').length > 0) {
      $(this)
        .toggleClass('on')
        .siblings()
        .stop(false, true)
        .slideToggle()
        .parent()
        .siblings()
        .children('.common-dolsca')
        .removeClass('on')
        .siblings()
        .stop(false, true)
        .slideUp()
    }
  })
  // 展开收缩逻辑结束

  // if ($(".j-header")) {
  //   $("body").css({
  //     paddingTop: $(".j-header").height() + "px",
  //   });
  //   console.log($(".j-header").height());

  //   $(window).resize(function () {
  //     $("body").css({
  //       paddingTop: $(".j-header").height() + "px",
  //     });
  //   });
  // }

  let str = ''
  for (let i = 1; i <= 6; i++) {
    for (let index = 1; index <= 100; index++) {
      const mbstr = function (flag) {
        const signStr = flag === 'add' ? '' : '-'
        return `${
          [1, 2].includes(i)
            ? `${signStr}${index * i}px`
            : `calc(${signStr}${index * i}px / ${i - 1})`
        }`
      }
      const getPercentage = function (iNum) {
        if (iNum === 3) {
          return 33.33
        } else if (iNum === 6) {
          return 16.66
        } else {
          return 100 / iNum
        }
      }
      str += `
      .common-items-ul-sm-w${i}-s${index} {
        margin-bottom: ${mbstr('sub')};
      }
      
      .common-items-ul-sm-w${i}-s${index} .common-items-li {
        width: ${i === 1 ? '100%' : `calc(${getPercentage(i)}% - ${index}px)`};
        margin-bottom: ${mbstr('add')};
      }
      `
    }
  }

  // console.log(str);

  let s = ''
  for (let j = 1; j <= 100; j++) {
    s += `
        .common-items-ul-s${j} {
          margin-bottom: -${j}px;
        }
        .common-items-ul-s${j} .common-items-li {
          margin-bottom: ${j}px;
        }
    `
  }
  // console.log(s);
})

const aaa = 10

const bbb = () => {
  return a
}
